﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model.AntiFake;
using BLL.AntiFake;
using Common;
namespace DAGApp
{
    /// <summary>
    /// FangWei 的摘要说明
    /// </summary>
    public class FangWei : IHttpHandler
    {
        JsonHelper jsonHelper = new JsonHelper();
        QueryCodeLogBLL bll = new QueryCodeLogBLL();
        public void ProcessRequest(HttpContext context)
        {
            string oper = context.Request.QueryString["oper"];
            string strResult = string.Empty;
            switch (oper)
            {
                case "GetList":
                    strResult = GetList(context);
                    break;
                default:
                    break;
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(strResult);
        }
        public string GetList(HttpContext context)
        {
            string codeSecret = context.Request.QueryString["code"];
            string code = MiMa.Jiemi(codeSecret, AppConst.DigitCodeKey);

            List<QueryCodeLogModel> list= bll.GetListByCode(code);
            return jsonHelper.SerializeObject(list);
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}